import { DatePicker, type DatePickerProps } from 'antd';

const DatePickerProxy = (props: DatePickerProps) => {
  return (
    <DatePicker style={{ width: '100%' }} needConfirm={false} {...props} />
  );
};

// RangePicker代理组件
const RangePickerProxy = (props: any) => {
  return (
    <DatePicker.RangePicker
      style={{ width: '100%' }}
      needConfirm={false}
      {...props}
    />
  );
};

// 创建新的DatePicker对象，包含代理的RangePicker
const DatePickerWithProxy = Object.assign(DatePickerProxy, {
  ...DatePicker,
  RangePicker: RangePickerProxy,
});

export default DatePickerWithProxy;
